<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /* 
        1.简单来说
            - 如果target对象上有个属性不可写也不可读
            - name使用代理会报错
     */
    const target = {};
    Object.defineProperty(target, 'foo', {
        configurable: false,
        writable: false,
        value: 'bar'
    });
    const handler = {
        get() {
            return 'qux';
        }
    }
    const proxy = new Proxy(target, handler);
    console.log(proxy.foo); // TypeError

</script>
</body>
</html>